#include"level.hpp"

int level_log=INF_LEVEL;

//用于测试接口
int set_level(int level)
{
    if(level>DBG_LEVEL)level=DBG_LEVEL;
    if(level<ERR_LEVEL)level=ERR_LEVEL;

    int old_level=level_log;
    level_log=level;
    return old_level;
}

std::string tid_to_str(const std::thread::id& tid)
{
    std::ostringstream oss;
    oss<<tid<<std::endl;
    return oss.str();
}

long long tid_to_ll(const std::thread::id& tid)
{
    return atoll(tid_to_str(tid).c_str());
}